<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>首页</title>
<%@ include file="/WEB-INF/jsp/common/inc.jsp" %>
<link rel="stylesheet" href="${_resources}bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="${_resources}bootstrap/bootstrap-table.min.css" />
<script type="text/javascript">
var demandList;
$(function (){
	demandList = $("#demandList").bootstrapTable({
		url : '${_baseUrl}/demandDefinition/getMyTaskDemandList?rand='+Math.random(),
		pagination: true,
		pageList: [5, 10, 20, 50],
		clickToSelect:false,
		cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
  		queryParams: queryParams,
        columns: [{
            title: '序号',
            width: 40,
            formatter: function(value, row, index){
            	return index+1;
            }
        }, {
            field: 'id',
            title: 'id',
            visible:false,
            width: 5
        }, {
            field: 'projectsupervision',
            title: 'projectsupervision',
            visible:false,
            width: 5
        },{
            field: 'name',
            title: '项目名称',
            width: 100,
            formatter: function(value, row, index){
           		return "<a onClick=\"skip();\" title='"+value+"'>"+value+"</a>"
            }
        },{
            field: 'projectload',
            title: '项目路径',
            width: 200
        },{
            field: 'userId',
            title: '项目负责人',
            width: 100
        },{
            field: 'createUserId',
            title: '需求负责人',
            width: 100
        }],onLoadSuccess:function(data){
            var cellIndex=parseInt($(".table_inline th").length);
            $(".table_inline tr td").each(function(){
                if(this.cellIndex != cellIndex){
                    $(this).attr("title",$(this).text());
                }
            });
         },
    });
	
	/* 项目名称缺省显示 */
	/* function subProjectName(name){
		if(name.length > 15){
			name = name.substring(0,15);
			name += "...";
		}
		return name;
	} */
	function queryParams(params){
		return {
		    pageSize: params.limit,
		    pageNo: params.pn,
		    sort : params.sort,
		    order : params.order,
		    name : $("#name").val() == "请输入" ? null : $("#name").val(),
	   }
	}
});
/* 跳转到文档编写 */
function skip(){
	parent.parent.parent.skipModule1("需求管理","${_baseUrl}/jurisdiction/menuList",'69268ed838914b7c86e5a191280249d5',"4341b3b1934345b3b19dff86500b3ee7","","");
}
function refreshTable(){
	demandList.bootstrapTable('refresh');
}
document.onkeydown=function(event)
{
    e = event ? event :(window.event ? window.event : null);
    if(e.keyCode==13){
        refreshTable();
    }
}
</script>
<style type="text/css">
	.fixed-table-container{border:0}
</style>
</head>
<body>
	<div>
	  	<div class="advanced_search">
    		<div class="advanced_search_div"></div>
             <input type="text" name="name" id="name" value="" placeholder="请输入项目名称" />
              <a class="magnifier" id="search" href="javascript:;" onclick="refreshTable()"></a>
        </div>
      <div style="overflow: auto; width:98%;margin: auto;">
	     <table class="table table-bordered table_inline" id="demandList"></table>           
    </div>
</div> 
</body>
</html>